﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.ServiceModel.Web;

// NOTE: If you change the interface name "IService" here, you must also update the reference to "IService" in Web.config.
[ServiceContract]
public interface IMoodleService
{

	    [OperationContract]
        [WebGet]
        string GetData(string value);

        [OperationContract]
        [WebGet]
        List<Activity> GetActivityCountByCourse(int courseid);
        
        // TODO: Add your service operations here
    }


    // Use a data contract as illustrated in the sample below to add composite types to service operations.
    [DataContract]
    public class Activity
    {
        public Activity(string name, int count)
        {
            Name = name;
            Count = count;
        }
        
        string Name = "";
        int Count = 0;

        [DataMember]
        public string ActivityName
        {
            get { return Name; }
            set { Name = value; }
        }

        [DataMember]
        public int ActivityCount
        {
            get { return Count; }
            set { Count = value; }
        }
    }
